//
//  AXFIconsCollectionViewCell.m
//  AXFEightGroup
//
//  Created by ooops on 12/28/16.
//  Copyright © 2016 ya. All rights reserved.
//

#import "AXFIconsCollectionViewCell.h"

@implementation AXFIconsCollectionViewCell


- (instancetype)initWithFrame:(CGRect)frame {
    if(self = [super initWithFrame:frame]) {
        CGRect rect = CGRectMake(15, -10, self.bounds.size.width - 30, self.bounds.size.height - 20);
        _imageView = [[UIImageView alloc] initWithFrame:rect];
        [self addSubview:_imageView];
        CGRect lblRect = CGRectMake(0, self.bounds.size.height - 25, self.bounds.size.width, 20);
        
        _lblName = [[UILabel alloc] initWithFrame:lblRect];
        _lblName.textAlignment = NSTextAlignmentCenter;
        _lblName.font = [UIFont systemFontOfSize:14];
        [self addSubview:_lblName];
    }
    return self;
}

- (void)setModel:(AXFDataModel *)model {
    _model = model;
    NSURL *url = [NSURL URLWithString:model.imgURL];
    [_imageView sd_setImageWithURL:url placeholderImage:SQUARESIZEPLACEHOLDER];
    _lblName.text = model.name;
}

@end
